package org.com.liurz.iresources.activiti;

import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.activiti.spring.SpringProcessEngineConfiguration;
import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer;
import org.com.liurz.iresources.activiti.listener.GlobeActivitiEventListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * activiti配置类
 * @author liurz
 * @version V1.0
 * @Package org.com.liurz.iresources.activiti
 * @date 2021/8/28 1:00
 * @Copyright © 2020-2028
 */
@Component
public class ActivitiConfig implements ProcessEngineConfigurationConfigurer {

    @Autowired

    private GlobeActivitiEventListener comActivitiEventListener;

    @Override

    public void configure(SpringProcessEngineConfiguration processEngineConfiguration) {
        List<ActivitiEventListener> activitiEventListener=new ArrayList<ActivitiEventListener>();
        activitiEventListener.add(comActivitiEventListener );//配置全局监听器
        processEngineConfiguration.setEventListeners(activitiEventListener);

    }

}
